package pl.bizuteria.sklep.api.product;

import javax.persistence.Id;
import javax.persistence.PrePersist;

public class Product {
	@Id
	public Long id;

	@PrePersist
	void onPersist() {
		this.version++;
	}

	Integer version = 0;

	public Product() {
	}

	public Product(Long id, Integer version) {
		super();
		this.id = id;
		this.version = version;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}
}
